<script type="text/javascript" src="<?=$this->baseUrl?>/library/ckeditor/ckeditor.js"></script>

<div id="titleTop" style="padding-top: 9px;">
	<div align="left">
		<?php if(!empty($this->errMsg)) :?>
			<?php $this->listError($this->errMsg,$this->lang_data); ?>
		<?php endif; ?>
	</div>
	<div class="titleTop-title"> <?php echo $this->lang_data->_("Add new service type");?> </div>
	<div class="clearDiv"></div>
</div>

<div id="form">
<form action="<?echo $this->baseUrl ?>/backend/servicetype/add" method="post" >

	<table width="100%" border="0" cellpadding="0" cellspacing="0">
	  <tr align="left">
		<td width="23"  class="form-header">&nbsp;</td>
		<td width="170" class="form-nameTitle"><?php print  $this->lang_data->_('Service Type Detail');?> </td>
		<td class="form-header">&nbsp;</td>
	  </tr>
	  <tr>
	  	<td class="form-row01">&nbsp; </td>
		<td class="form-name1"> <?php print  $this->lang_data->_('Vietnamese Name') ?> :</td>
	    <td class="form-row01"><input type="text"  class="textBox" name="name_vn" id="name_vn" value="" /></td>
	  </tr>
          <tr>
	  	<td class="form-row01">&nbsp; </td>
		<td class="form-name1"> <?php print  $this->lang_data->_('English Name') ?> :</td>
	    <td class="form-row01"><input type="text"  class="textBox" name="name_en" id="name_en" value="" /></td>
	  </tr>
          <tr>
	  	<td class="form-row02">&nbsp; </td>
		<td class="form-name2"><?php print  $this->lang_data->_('Service types'); ?> :</td>
	    <td class="form-row02">
                <?php $this->listSelects($this,'parent_id',$this->serviceTypes); ?>
            </td>
	  </tr>
	  <tr>
	 	<td class="form-row02">&nbsp; </td>
		<td class="form-name2"></td>
	  	<td class="form-row02">
	  		<input type="submit" class="button" name="submit" id="submit" value="<?php print  $this->lang_data->_('OK'); ?>"/>
	  		<input type="reset"  class="button" name="reset"  id="reset"  value="<?php print  $this->lang_data->_('Reset'); ?>"/>
	  		<input type="button"  class="button" name="back"  id="back"  value="<?php print  $this->lang_data->_('Back'); ?>" onclick="window.location='<?php echo $this->baseUrl."/backend/servicetype"; ?>'"/>
	  	</td>
	  </tr>
	</table>
</form>
</div>
<div class="clearDiv"> </div>
<div style="height: 30px;"></div>
<script type="text/javascript">
$('#submit').click(function(){

    if(haveSpecialChars($('#name_vn').val()))
    {
        alert("Tên loại dịch vụ không thể có ký tự đặc biệt");
        return false;
    }

    if(haveSpecialChars($('#name_en').val()))
    {
        alert("Tên loại dịch vụ không thể có ký tự đặc biệt");
        return false;
    }

    if (isWhitespace($('#name_en').val()) && isWhitespace($('#name_vn').val()))
    {
        alert("Vui lòng nhập tên tiếng viêt hoặc tiếng anh.");
        return false;
    }
})
</script>